package com.fcscs.cservice.client.main.configuration.iguest;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.IconButtonEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.fcscs.core.common.authority.CServiceAuthority;
import com.fcscs.core.common.authority.UserAuthority;
import com.fcscs.core.domain.IdNameModel;
import com.fcscs.core.domain.Property;
import com.fcscs.core.gwt.common.AsyncCallbackListener;
import com.fcscs.core.gwt.common.CoreConstants;
import com.fcscs.core.gwt.common.SessionContext;
import com.fcscs.core.gwt.common.ui.CenteredInfo;
import com.fcscs.core.gwt.common.ui.FcsFields.EasyClearCombobox;
import com.fcscs.core.gwt.common.ui.FcsFields.FormButton;
import com.fcscs.core.gwt.common.ui.FcsFields.HighLightIconButton;
import com.fcscs.core.gwt.common.ui.FcsPanel;
import com.fcscs.cservice.client.common.CServiceConstants;
import com.fcscs.cservice.client.common.MultiLanguageConstants;
import com.fcscs.cservice.client.common.controller.CServiceCommonServiceController;

import com.fcscs.cservice.client.common.model.configuration.iguest.OrderAcknowledgementTemplateGWTEnum;
import com.fcscs.cservice.client.common.model.configuration.iguest.OrderAcknowledgementTemplateGWTEnumModelData;
import com.fcscs.cservice.client.common.model.configuration.iguest.OrderMessageTemplateGWTEnum;
import com.fcscs.cservice.client.common.model.configuration.iguest.OrderMessageTemplateGWTEnumModelData;
import com.fcscs.cservice.client.common.model.configuration.reservation.PropertyIdNameModelData;

import com.fcscs.cservice.domain.ConstantsLanguageValue;
import com.fcscs.cservice.domain.ConstantsLanguageValueId;
import com.fcscs.cservice.domain.HouseKeepingConfig;

import com.fcscs.share.gwt.common.ShareGWTConstants;
import com.fcscs.share.gwt.common.ui.MultiLanguageDialog;
import com.fcscs.share.gwt.common.ui.event.MultiLanguageDialogEventHandler;
import com.fcscs.share.gwt.common.ui.event.MultiLanguageDialogOKEvent;
import com.google.gwt.user.client.Window;

import com.google.gwt.user.client.ui.Widget;

public class iGuestHouseKeepingPanel extends FcsPanel {
	private VerticalPanel vp;
	private FieldSet fieldset1;
	private FieldSet fieldset2;
	private FieldSet fieldset3;
	private FieldSet fieldset4;
	private FieldSet fieldset5;
	private FieldSet fieldset6;
	private FieldSet fieldset7;
	private Radio emailRadio;
	private Radio printerRadio;
	private Radio econnectRadio;
	private Radio cconnectRadio;
	private TextField<String> emailAddressField;
	private TextField<String> serverNameField;
	private TextField<String> econnectrequestfield;
	private TextField<String> timeoutmField;
	private TextField<String> timeoutmemailField;
	private TextField<String> cancellationminuteField;
	private TextField<String> fromHousekeepingField;
	private TextField<String> subjectHousekeepingField;
	private TextField<String> subjectOrderChange;
	private TextField<String> subjectOrderCancellation;
	private TextArea textareaOutofreservation;
	private TextArea textareaExpecteddelivery;
	private TextArea textareaOrdermessagetemplate;
	private EasyClearCombobox<OrderMessageTemplateGWTEnumModelData> eRequestActionCombox;
	private EasyClearCombobox<OrderMessageTemplateGWTEnumModelData> cRequestActionCombox;
	private EasyClearCombobox<OrderMessageTemplateGWTEnumModelData> orderMesTemCombox;
	
	private boolean isFocus = true;
	private EasyClearCombobox<PropertyIdNameModelData> propCombox;
	private ListStore<PropertyIdNameModelData> propListStore;
	private List<IdNameModel<Property>> propGroupIdNames;
	private ListStore<OrderMessageTemplateGWTEnumModelData> eRequestActionStore;
	private ListStore<OrderMessageTemplateGWTEnumModelData> cRequestActionStore;
	private ListStore<OrderMessageTemplateGWTEnumModelData> orderMesTemStore;
	private FieldSet fieldsetordermes;
	private FieldSet fieldsetSubjectordertimeout;
	private TextField<String> subjectOrderTimeoutAlertField;
	private FieldSet fieldsetSubjectorderChangetimeout;
	private TextField<String> subjectOrderChangeTimeoutAlertField;
	private TextField<String> subjectOrderCancelTimeoutAlertField;
	private FieldSet fieldsetSubjectorderCanceltimeout;
	private FieldSet fieldsetTimeoutordermes;
	private ComboBox<OrderMessageTemplateGWTEnumModelData> orderTimeoutMesTemCombox;
	private ListStore<OrderMessageTemplateGWTEnumModelData> orderTimeoutMesTemStore;
	private TextArea textareaOrderTimeoutmessagetemplate;
	private FieldSet fieldsetSubjectorderAcknowledgement;
	private TextField<String> subjectOrderAcknowledgementField;
	private FieldSet fieldsetAcknowledgementordermes;
	private EasyClearCombobox<OrderAcknowledgementTemplateGWTEnumModelData> orderAcknowledgementMesTemCombox;
	private ListStore<OrderAcknowledgementTemplateGWTEnumModelData> orderAcknowledgementMesTemStore;
	private TextArea textareaAcknowledgementmessagetemplate;
	private FieldSet fieldsetSubjectorderChangeAcknowledgement;
	private TextField<String> subjectOrderChangeAcknowledgementField;
	private FieldSet fieldsetChangeAcknowledgementordermes;
	private EasyClearCombobox<OrderAcknowledgementTemplateGWTEnumModelData> orderChangeAcknowledgementMesTemCombox;
	private ListStore<OrderAcknowledgementTemplateGWTEnumModelData> orderChangeAcknowledgementMesTemStore;
	private TextArea textareaChangeAcknowledgementmessagetemplate;
	private HouseKeepingConfig currentHousekeepingConf;
	private CheckBox timeoutCheckBox;
	private CheckBox cancellationCheckBox;
	private MultiLanguageDialog detailsOutofReserDialog;
	private MultiLanguageDialog detailsExpectedDialog;
	private Map<String, String> detailsOutofReserMap;
	private Map<String, String> detailsExpectedMap;
	private MultiLanguageDialog fromHousekeepingDialog;
	private Map<String, String> fromHousekeepingMap;
	private MultiLanguageDialog subjectHousekeepingDialog;
	private Map<String, String> subjectHousekeepingMap;
	private MultiLanguageDialog subjectOrderChangeDialog;
	private Map<String, String> subjectOrderChangeMap;
	private MultiLanguageDialog subjectOrderCancelDialog;
	private Map<String, String> subjectOrderCancelMap;
	private MultiLanguageDialog subjectOrderTimeoutDialog;
	private Map<String, String> subjectOrderTimeoutMap;
	private MultiLanguageDialog subjectOrderChangeTimeoutDialog;
	private Map<String, String> subjectOrderChangeTimeoutMap;
	private MultiLanguageDialog subjectOrderCancelTimeoutDialog;
	private Map<String, String> subjectOrderCancelTimeoutMap;
	private MultiLanguageDialog subjectOrderAcknowledgementDialog;
	private Map<String, String> subjectOrderAcknowledgementMap;
	private MultiLanguageDialog subjectOrderChangeAcknowledgementDialog;
	private Map<String, String> subjectOrderChangeAcknowledgementMap;
	private boolean isChange;
	private FormButton saveButton;
	
	private String currentOutOfReserString;
	private String currentExpectedString;
	private String currentFromHKString;
	private String currentSubjectHKSring;
	private String currentSubjectOrderChangeString;
	private String currentSubjectOrderCancelString;
	private String currentSubjectOrderTimeoutString;
	private String currentSubjectOrderChangeTimeoutString;
	private String currentSubjectOrderCancelTimeoutString;
	private String currentSubjectOrderAckString;
	private String currentSubjectOrderChangeAckString;
	
	public iGuestHouseKeepingPanel(String id) {
		super(id);
	}

	public HighLightIconButton MultiEditBtn(){
		HighLightIconButton iconBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON, new SelectionListener<IconButtonEvent>() {
					public void componentSelected(IconButtonEvent ie){
						//dialog show method
					}
				});
		iconBtn.setTitle(CoreConstants.CORE_CONSTANTS.edit());
		return iconBtn;
	}

	@Override
	public void init() {
		vp = new VerticalPanel();
		vp.setId("iGuestHousekeepingPanel_vpPanel");
		vp.setSpacing(5);
		
		LayoutContainer lc = new LayoutContainer();
		lc.setId("iGuestHousekeepingPanel_lc");
		lc.setLayout(new ColumnLayout());
		
		Label propLabel = new Label(CoreConstants.CORE_CONSTANTS.property() + CoreConstants.REQURIED_FIELD_LABEL);
		propLabel.setId("iGuestHousekeepingPanel_propLabel");
		
		propListStore = new ListStore<PropertyIdNameModelData>();
		propCombox = new EasyClearCombobox<PropertyIdNameModelData>();
		propCombox.setId("iGuestHousekeepingPanel_propCombox");
//		propCombox.setFieldLabel(CoreConstants.CORE_CONSTANTS.property());
		propCombox.setWidth(200);
		propCombox.setDisplayField(CoreConstants.FULLTNAME);
		propCombox.setAllowBlank(false);
		propCombox.setForceSelection(true);
		propCombox.setTriggerAction(TriggerAction.ALL);
		propCombox.setStore(propListStore);
		propCombox.addSelectionChangedListener(new SelectionChangedListener<PropertyIdNameModelData>(){
			@Override
			public void selectionChanged(SelectionChangedEvent<PropertyIdNameModelData> se) {
				myClear();
//				ReservationServiceController.getINSTANCE().getCheckInConf(
//						propCombox.getValue().getEntity().getId(), 
//						new AsyncCallbackListener<CheckInConfiguration>(){
//							@Override
//							public void onLogin(String username) {
//								ReservationServiceController.getINSTANCE().getCheckInConf(
//										SessionContext.getInstance().getPropertyId(),this);
//							}
//							@Override
//							public void onFailure(Throwable caught) {
//								MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
//										CoreConstants.CORE_CONSTANTS.systemError(), null);
//							}
//							@Override
//							public void onSuccess(CheckInConfiguration result) {
//								if(null != result){
//									currentCheckInConf = result;
//									if(null != result.getReqDest()
//										&& result.getReqDest().getDestTypeEnum().equals(NotifDestType.EMAIL)){
//										isFocus = true;
//										printerRadio.setValue(false);
//										emailRadio.setValue(true);
//										emailAddressField.setValue(result.getReqDest().getDestination());
//									}else if(null != result.getReqDest()
//										&& result.getReqDest().getDestTypeEnum().equals(NotifDestType.PRINTER)){
//										isFocus = false;
//										emailRadio.setValue(false);
//										printerRadio.setValue(true);
//										serverNameField.setValue(result.getReqDest().getDestination());
//									}
//									
//									if(null != result.getReqTmpl()){
//										titleField.setValue(result.getReqTmpl().getTitle());
//										textArea.setValue(result.getReqTmpl().getDetail());
//									}
//									
//									timeOutField.setValue(result.getReqTimeout()+"");
//									
//									if(null != result.getToAlertDest()
//											&& result.getToAlertDest().getDestTypeEnum().equals(NotifDestType.EMAIL)){
//											printerRadioAlert.setValue(false);
//											emailRadioAlert.setValue(true);
//											emailAddressField1.setValue(result.getToAlertDest().getDestination());
//									}else if(null != result.getToAlertDest()
//											&& result.getToAlertDest().getDestTypeEnum().equals(NotifDestType.PRINTER)){
//											emailRadioAlert.setValue(false);
//											printerRadioAlert.setValue(true);
//											serverNameField1.setValue(result.getToAlertDest().getDestination());
//									}
//									
//									if(null != result.getToAlertTmpl()){
//										titleField1.setValue(result.getToAlertTmpl().getTitle());
//										textArea1.setValue(result.getToAlertTmpl().getDetail());
//									}
//								}
//							}
//						});
			}
		});
		
		lc.add(propLabel, new ColumnData(70));
		lc.add(propCombox, new ColumnData(160));
		
		vp.add(lc);
		
		FormPanel panel = new FormPanel();
		panel.setId("iGuestHousekeepingPanel_panel");
		panel.setFrame(true);
		panel.setHeading(CServiceConstants.CSERVICE_CONSTANTS.housekeeping());
		panel.setPadding(10);
		panel.setSize(730, 530);
		panel.setScrollMode(Scroll.AUTOY);
		panel.setLabelAlign(LabelAlign.LEFT);
		panel.setLabelSeparator("");
		panel.setLabelWidth(100);
		panel.setFieldWidth(400);
		
		LayoutContainer lca = new LayoutContainer();
		
		fieldset1 = new FieldSet();
		fieldset1.setWidth(650);
		fieldset1.setId("iGuestHousekeepingPanel_fieldset1");
		fieldset1.setHeading(CServiceConstants.CSERVICE_CONSTANTS.sendRequestTo());
		
	    panel.add(fieldset1);
		
		lca.setId("iGuestHousekeepingPanel_lca");
	    FormLayout layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(100);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lca.setLayout(layout);
		lca.setBorders(false);
		
		emailRadio = new Radio();
		emailRadio.setId("iGuestHousekeepingPanel_emailRadio");
		emailRadio.setBoxLabel(ShareGWTConstants.SHARE_GWT_CONSTANTS.email() + CServiceConstants.FIELD_SEP);
		emailRadio.setValue(false);
		emailRadio.addListener(Events.Change, new Listener<BaseEvent>(){
			@Override
			public void handleEvent(BaseEvent be) {
				if(emailRadio.getValue()){
					if(currentHousekeepingConf.getRequestSentTo()!=2 || isChange){
						saveButton.setEnabled(true);
						isChange=true;
					}
					printerRadio.setValue(false);
					econnectRadio.setValue(false);
					cconnectRadio.setValue(false);
					serverNameField.setEnabled(false);
					eRequestActionCombox.setEnabled(false);
					cRequestActionCombox.setEnabled(false);
					serverNameField.clear();
					eRequestActionCombox.clear();
					
					emailAddressField.setEnabled(true);
					emailAddressField.focus();
				}else{
					emailAddressField.setEnabled(false);
					emailAddressField.clear();
				}
			}
	    });

		printerRadio = new Radio();
		printerRadio.setId("iGuestHousekeepingPanel_printerRadio");
		printerRadio.setValue(true);
		printerRadio.setBoxLabel(ShareGWTConstants.SHARE_GWT_CONSTANTS.printer() + CServiceConstants.FIELD_SEP);
		printerRadio.addListener(Events.Change, new Listener<BaseEvent>(){
			@Override
			public void handleEvent(BaseEvent be) {
				if(printerRadio.getValue()){
					if(currentHousekeepingConf.getRequestSentTo()!=0 || isChange){
						saveButton.setEnabled(true);
						isChange=true;
					}
					emailRadio.setValue(false);
					econnectRadio.setValue(false);
					cconnectRadio.setValue(false);
					emailAddressField.setEnabled(false);
					eRequestActionCombox.setEnabled(false);
					cRequestActionCombox.setEnabled(false);
					emailAddressField.clear();
					eRequestActionCombox.clear();
					
					serverNameField.setEnabled(true);
					serverNameField.focus();
					
				}else{
					serverNameField.setEnabled(false);
					serverNameField.clear();
				}
			}
	    });
		
		econnectRadio = new Radio();
		econnectRadio.setId("iGuestHousekeepingPanel_printerRadio");
		econnectRadio.setBoxLabel(ShareGWTConstants.SHARE_GWT_CONSTANTS.econnect() + CServiceConstants.FIELD_SEP);
		econnectRadio.addListener(Events.Change, new Listener<BaseEvent>(){
			@Override
			public void handleEvent(BaseEvent be) {
				if(econnectRadio.getValue()){
					if(currentHousekeepingConf.getRequestSentTo()!=1 || isChange){
						saveButton.setEnabled(true);
						isChange=true;
					}
					emailRadio.setValue(false);
					printerRadio.setValue(false);
					cconnectRadio.setValue(false);
					emailAddressField.setEnabled(false);
					serverNameField.setEnabled(false);
					cRequestActionCombox.setEnabled(false);
					emailAddressField.clear();
					serverNameField.clear();
					
					eRequestActionCombox.setEnabled(true);
					eRequestActionCombox.focus();
				}else{
					eRequestActionCombox.setEnabled(false);
					eRequestActionCombox.clear();
				}
			}
	    });
		
		cconnectRadio = new Radio();
		cconnectRadio.setId("iGuestHousekeepingPanel_printerRadio");
		cconnectRadio.setBoxLabel(ShareGWTConstants.SHARE_GWT_CONSTANTS.cconnect() + CServiceConstants.FIELD_SEP);
		cconnectRadio.addListener(Events.Change, new Listener<BaseEvent>(){
			@Override
			public void handleEvent(BaseEvent be) {
				if(cconnectRadio.getValue()){
//					cconnectrequestfield.setEnabled(true);
//					econnectrequestfield.focus();
					if(currentHousekeepingConf.getRequestSentTo()!=3 || isChange){
						saveButton.setEnabled(true);
						isChange=true;
					}
					cRequestActionCombox.setEnabled(true);
					cRequestActionCombox.focus();
					emailRadio.setValue(false);
					printerRadio.setValue(false);
					econnectRadio.setValue(false);
					emailAddressField.setEnabled(false);
					serverNameField.setEnabled(false);
					eRequestActionCombox.setEnabled(false);
					
					emailAddressField.clear();
					serverNameField.clear();
					eRequestActionCombox.clear();
				}else{
					cRequestActionCombox.setEnabled(false);
//					econnectrequestfield.clear();
				}
			}
	    });
	    
	    final TextField<String> sendRequestField = new TextField<String>();
		sendRequestField.setId("iGuestHousekeepingPanel_sendRequestField");
		sendRequestField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.sendRequestTo()+ CServiceConstants.FIELD_SEP);
		sendRequestField.setWidth(250);
		sendRequestField.addListener(Events.OnBlur, new Listener<BaseEvent>() {

			@Override
			public void handleEvent(BaseEvent be) {
				
			}
		});
		
		serverNameField = new TextField<String>();
	    serverNameField.setId("iGuestHousekeepingPanel_serverNameField");
	    serverNameField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.serverName() + CServiceConstants.FIELD_SEP);
	    serverNameField.setVisible(true);
	    serverNameField.setEnabled(true);
	    serverNameField.focus();
	    serverNameField.setWidth(200);
	    serverNameField.setAllowBlank(false);
	    serverNameField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 100){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.serverName(), 50);
				}
				return null;
			}
        });
	    serverNameField.addListener(Events.KeyUp, new Listener<BaseEvent>() {

			@Override
			public void handleEvent(BaseEvent be) {
				// TODO Auto-generated method stub
				if(!serverNameField.getValue().trim().equals(currentHousekeepingConf.getPrinterEmailAction())||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else{
					isChange=false;
				}
			}
		});
	    
	    eRequestActionCombox = new EasyClearCombobox<OrderMessageTemplateGWTEnumModelData>();
	    eRequestActionCombox.setId("RestaurantConfigPanel_cRequestActionCombox");
	    eRequestActionCombox.setEnabled(false);
	    eRequestActionCombox.setForceSelection(true);
		eRequestActionStore = new ListStore<OrderMessageTemplateGWTEnumModelData>();
		eRequestActionCombox.setWidth(200);
		eRequestActionCombox.setStore(eRequestActionStore);
	    
	    emailAddressField = new TextField<String>();
	    emailAddressField.setId("iGuestHousekeepingPanel_emailAddressField");
	    emailAddressField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.emailAddress() + CServiceConstants.FIELD_SEP);
	    emailAddressField.setVisible(true);
	    emailAddressField.setEnabled(false);
	    emailAddressField.setWidth(200);
	    emailAddressField.setAllowBlank(false);
	    
	    final String emailReg = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
	    emailAddressField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if (!value.toUpperCase().matches(emailReg)) {
					return ShareGWTConstants.SHARE_GWT_CONSTANTS.emailErro();
				} else if (value.length() > 50) {
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CoreConstants.CORE_CONSTANTS.email(), 50);
				}
				return null;
			}
        });
	    emailAddressField.addListener(Events.KeyUp, new Listener<BaseEvent>() {

			@Override
			public void handleEvent(BaseEvent be) {
				// TODO Auto-generated method stub
				if(!emailAddressField.getValue().trim().equals(currentHousekeepingConf.getPrinterEmailAction())||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else{
					isChange=false;
				}
			}
		});
	    
//	    final String emailReg = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
//		addressfield.setValidator(new Validator() {
//			@Override
//			public String validate(Field<?> field, String value) {
//				if (!value.toUpperCase().matches(emailReg)) {
//					return ShareGWTConstants.SHARE_GWT_CONSTANTS.emailErro();
//				} else if (value.length() > 50) {
//					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
//							CoreConstants.CORE_CONSTANTS.email(), 50);
//				}
//				return null;
//			}
//		});
	    
	    econnectrequestfield = new TextField<String>();
	    econnectrequestfield.setId("iGuestHousekeepingPanel_econnectrequestfield");
	    econnectrequestfield.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.requestAction() + CServiceConstants.FIELD_SEP);
	    econnectrequestfield.setVisible(true);
	    econnectrequestfield.setEnabled(false);
	    econnectrequestfield.setAllowBlank(false);
	    econnectrequestfield.setWidth(200);
	    econnectrequestfield.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 100){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.requestAction(), 100);
				}
				return null;
			}
        });
		
	    cRequestActionCombox = new EasyClearCombobox<OrderMessageTemplateGWTEnumModelData>();
	    cRequestActionCombox.setId("RestaurantConfigPanel_cRequestActionCombox");
		cRequestActionCombox.setEnabled(false);
		cRequestActionCombox.setForceSelection(true);
		cRequestActionStore = new ListStore<OrderMessageTemplateGWTEnumModelData>();
		cRequestActionCombox.setWidth(200);
		cRequestActionCombox.setStore(cRequestActionStore);
	    
		VerticalPanel sendrequesttopanelvp = new VerticalPanel();
		HorizontalPanel radiogrouphp = new HorizontalPanel();
		VerticalPanel radiovp = new VerticalPanel();
		VerticalPanel labelradiovp = new VerticalPanel();
		VerticalPanel textfieldradiovp = new VerticalPanel();
		
		sendrequesttopanelvp.setSpacing(5);
//		radiogrouphp.setSpacing(5);
		radiovp.setSpacing(5);
		labelradiovp.setSpacing(8);
		textfieldradiovp.setSpacing(5);
		textfieldradiovp.setWidth(200);
	    
	    radiogrouphp.add(radiovp);
	    radiogrouphp.add(labelradiovp);
	    radiogrouphp.add(textfieldradiovp);
	    	    
	    radiovp.add(printerRadio);
	    radiovp.add(econnectRadio);
	    radiovp.add(emailRadio);
	    radiovp.add(cconnectRadio);
	    
	    Label labelservername = new Label(CServiceConstants.CSERVICE_CONSTANTS.serverName() + CServiceConstants.FIELD_SEP);
	    Label labelrequestaction1 = new Label(CServiceConstants.CSERVICE_CONSTANTS.requestAction()+ CServiceConstants.FIELD_SEP);
	    Label labelemailaddress = new Label(CServiceConstants.CSERVICE_CONSTANTS.emailAddress()+ CServiceConstants.FIELD_SEP);
	    Label labelrequestaction2 = new Label(CServiceConstants.CSERVICE_CONSTANTS.requestAction() + CServiceConstants.FIELD_SEP);
	    
	    labelradiovp.add(labelservername);
	    labelradiovp.add(labelrequestaction1);
	    labelradiovp.add(labelemailaddress);
	    labelradiovp.add(labelrequestaction2);
	    
	    textfieldradiovp.add(serverNameField);
	    textfieldradiovp.add(eRequestActionCombox);
	    textfieldradiovp.add(emailAddressField);
	    textfieldradiovp.add(cRequestActionCombox);

	    sendrequesttopanelvp.add(radiogrouphp);
	    
	    timeoutCheckBox = new CheckBox();
	    timeoutCheckBox.setId("RestaurantConfigPanel_ackCheckBox");
	    timeoutCheckBox.setBoxLabel(CServiceConstants.CSERVICE_CONSTANTS.timeOut()+CServiceConstants.FIELD_SEP);
	    timeoutCheckBox.addListener(Events.OnClick, new Listener<BaseEvent>() {
			@Override
			public void handleEvent(BaseEvent be) {
				if (timeoutCheckBox.getValue()) {
					timeoutmField.setEnabled(true);
					timeoutmemailField.setEnabled(true);
					timeoutmField.focus();
				}else {
					timeoutmField.setEnabled(false);
					timeoutmemailField.setEnabled(false);
					timeoutmField.clear();
					timeoutmemailField.clear();
				}
			}
		});
	    
	    cancellationCheckBox = new CheckBox();
	    cancellationCheckBox.setId("RestaurantConfigPanel_ackCheckBox");
	    cancellationCheckBox.setBoxLabel(CServiceConstants.CSERVICE_CONSTANTS.cancellationdefault()+CServiceConstants.FIELD_SEP);
	    cancellationCheckBox.addListener(Events.OnClick, new Listener<BaseEvent>() {
			@Override
			public void handleEvent(BaseEvent be) {
				if (cancellationCheckBox.getValue()) {
					cancellationminuteField.setEnabled(true);
					cancellationminuteField.focus();
				}else {
					cancellationminuteField.setEnabled(false);
					cancellationminuteField.clear();
				}
			}
		});
	    
	    timeoutmField = new TextField<String>();
	    timeoutmField.setId("iGuestHousekeepingPanel_timeoutm");
	    timeoutmField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.timeOut() + CServiceConstants.FIELD_SEP);
	    timeoutmField.setVisible(true);
	    timeoutmField.setEnabled(false);
	    timeoutmField.setWidth(50);
	    timeoutmField.setAllowBlank(false);
	    timeoutmField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 10){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.timeOut(), 10);
				}
				if(!isValidNum(value.trim())){
					return CServiceConstants.CSERVICE_MESSAGES.enterNumBetweenAnd("1", "1440");
				}
				return null;
			}
        });
	    timeoutmField.addListener(Events.KeyUp, new Listener<BaseEvent>() {

			@Override
			public void handleEvent(BaseEvent be) {
				// TODO Auto-generated method stub
				if(!timeoutmField.getValue().trim().equals(currentHousekeepingConf.getTimeOut())||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					isChange=false;
			}
		});
	    
//	    public String validate(Field<?> field, String value) {
//			if(value == null){
//				return CoreConstants.CORE_CONSTANTS.requiredField();
//			}else if(value.trim().isEmpty()){
//				return ShareGWTConstants.SHARE_GWT_CONSTANTS.cannotEmpty();
//			}else if(!isValidNum(value.trim())){
//				return CServiceConstants.CSERVICE_MESSAGES.enterNumBetweenAnd("1", "1440");
//			}
//			return null;
//		}
	    
	    timeoutmemailField = new TextField<String>();
	    timeoutmemailField.setId("iGuestHousekeepingPanel_timeoutmfield");
	    timeoutmemailField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.emailAddress() + CServiceConstants.FIELD_SEP);
//	    serverNameField.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "80px");
	    timeoutmemailField.setVisible(true);
	    timeoutmemailField.setAllowBlank(false);
	    timeoutmemailField.setEnabled(false);
	    timeoutmemailField.setWidth(200);
	    
	    timeoutmemailField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if (!value.toUpperCase().matches(emailReg)) {
					return ShareGWTConstants.SHARE_GWT_CONSTANTS.emailErro();
				} else if (value.length() > 50) {
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CoreConstants.CORE_CONSTANTS.email(), 50);
				}
				return null;
			}
        });
	    timeoutmemailField.addListener(Events.KeyUp, new Listener<BaseEvent>() {

			@Override
			public void handleEvent(BaseEvent be) {
				// TODO Auto-generated method stub
				if(!timeoutmemailField.getValue().trim().equals(currentHousekeepingConf.getTimeOutEmail())||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					isChange=false;
			}
		});
	    
	    cancellationminuteField = new TextField<String>();
	    cancellationminuteField.setId("iGuestHousekeepingPanel_cancellation");
	    cancellationminuteField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.minute() + CServiceConstants.FIELD_SEP);
//	    serverNameField.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "80px");
	    cancellationminuteField.setVisible(true);
	    cancellationminuteField.setEnabled(false);
	    cancellationminuteField.setWidth(50);
	    cancellationminuteField.setAllowBlank(false);
//	    econnectrequestfield.setWidth(300);
	    cancellationminuteField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 10){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.minute(), 10);
				}
				if(!isValidNum(value.trim())){
					return CServiceConstants.CSERVICE_MESSAGES.enterNumBetweenAnd("1", "1440");
				}
				return null;
			}
        });
	    cancellationminuteField.addListener(Events.KeyUp, new Listener<BaseEvent>() {

			@Override
			public void handleEvent(BaseEvent be) {
				// TODO Auto-generated method stub
				if(!cancellationminuteField.getValue().trim().equals(currentHousekeepingConf.getCancellationMinutes())||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					isChange=false;
			}
		});
	    
	    HorizontalPanel timeoutHp = new HorizontalPanel();
	    VerticalPanel timeoutcheckboxVp = new VerticalPanel();
	    VerticalPanel timeoutlabelVp = new VerticalPanel();
	    VerticalPanel timeouttextfieldboxVp = new VerticalPanel();
	    VerticalPanel timeoutemaillabelVp = new VerticalPanel();
	    VerticalPanel timeoutemailtextfieldVp = new VerticalPanel();
	    
	    timeoutHp.setSpacing(5);
	    timeoutcheckboxVp.setWidth(175);
	    timeoutlabelVp.setWidth(80);
	    timeoutemailtextfieldVp.setWidth(150);
	    
	    timeoutcheckboxVp.add(timeoutCheckBox);
	    timeoutlabelVp.add(new Label(CServiceConstants.CSERVICE_CONSTANTS.timeOut() + CServiceConstants.FIELD_SEP));
	    timeouttextfieldboxVp.add(timeoutmField);
	    timeoutemaillabelVp.add(new Label(CServiceConstants.CSERVICE_CONSTANTS.emailAddress() + CServiceConstants.FIELD_SEP));
	    timeoutemailtextfieldVp.add(timeoutmemailField);
	    
	    timeoutHp.add(timeoutcheckboxVp);
	    timeoutHp.add(timeoutlabelVp);
	    timeoutHp.add(timeouttextfieldboxVp);
	    timeoutHp.add(timeoutemaillabelVp);
	    timeoutHp.add(timeoutemailtextfieldVp);
	    
	    sendrequesttopanelvp.add(timeoutHp);
	    
	    HorizontalPanel cancellationHp = new HorizontalPanel();
	    VerticalPanel cancelcheckboxVp = new VerticalPanel();
	    VerticalPanel cancellabelVp = new VerticalPanel();
	    VerticalPanel canceltextfieldVp = new VerticalPanel();
	    
	    cancellationHp.setSpacing(5);
	    cancelcheckboxVp.setWidth(205);
	    cancellabelVp.setWidth(50);
	    
	    cancelcheckboxVp.add(cancellationCheckBox);
	    cancellabelVp.add(new Label(CServiceConstants.CSERVICE_CONSTANTS.minute() + CServiceConstants.FIELD_SEP));
	    canceltextfieldVp.add(cancellationminuteField);
	    
	    cancellationHp.add(cancelcheckboxVp);
	    cancellationHp.add(cancellabelVp);
	    cancellationHp.add(canceltextfieldVp);
	    
	    sendrequesttopanelvp.add(cancellationHp);
	    
	    lca.add(sendrequesttopanelvp);
	    
		fieldset1.add(lca);
	    
	    LayoutContainer lcb = new LayoutContainer();
	    
	    fieldset2 = new FieldSet();
		fieldset2.setWidth(650);
		fieldset2.setId("iGuestHousekeepingPanel_fieldset2");
		fieldset2.setHeading(CServiceConstants.CSERVICE_CONSTANTS.outReserPeriod()+ CoreConstants.REQURIED_FIELD_LABEL);
		fieldset2.add(lcb);
	    panel.add(fieldset2);
	    
	    lcb.setId("iGuestHousekeepingPanel_lcb");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcb.setLayout(layout);
		lcb.setBorders(false);
	  

	    textareaOutofreservation = new TextArea();
	    textareaOutofreservation.setId("iGuestHousekeepingPanel_textareaOutofreservation");
	    textareaOutofreservation.setValue(CServiceConstants.CSERVICE_CONSTANTS.outofreservationmes());
	    textareaOutofreservation.setReadOnly(true);
	    textareaOutofreservation.setHeight(50);
	    textareaOutofreservation.setWidth(400);
	    textareaOutofreservation.setFieldLabel(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP);
	    
	    detailsOutofReserDialog = new MultiLanguageDialog();
	    detailsOutofReserDialog.setAllowBlank(false);
	    detailsOutofReserDialog.setMultiLine(true);
	    detailsOutofReserDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				textareaOutofreservation.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentOutOfReserString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton detailsOutofReserBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						detailsOutofReserDialog.show();
					}
				});
	    
	    HorizontalPanel outofreservationHp = new HorizontalPanel();
	    VerticalPanel outofreservationLabelVp = new VerticalPanel();
	    VerticalPanel outofreservationTextareaVp = new VerticalPanel();
	    VerticalPanel outofreservationIconVp = new VerticalPanel();
	    
	    outofreservationLabelVp.setWidth(100);
	    outofreservationIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    
	    outofreservationLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP));
	    outofreservationTextareaVp.add(textareaOutofreservation);
	    outofreservationIconVp.add(detailsOutofReserBtn);
	    
	    outofreservationHp.add(outofreservationLabelVp);
	    outofreservationHp.add(outofreservationTextareaVp);
	    outofreservationHp.add(outofreservationIconVp);
	   
	    lcb.add(outofreservationHp);
        
        LayoutContainer lcc = new LayoutContainer();
        lcc.setId("iGuestHousekeepingPanel_lcc");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcc.setLayout(layout);
		lcc.setBorders(false);
		
		fieldset3 = new FieldSet();
		fieldset3.setWidth(650);
		fieldset3.setId("iGuestHousekeepingPanel_fieldset3");
		fieldset3.setHeading(CServiceConstants.CSERVICE_CONSTANTS.expDeliveryTime()+ CoreConstants.REQURIED_FIELD_LABEL);
		fieldset3.add(lcc);
	    panel.add(fieldset3);
        
        textareaExpecteddelivery = new TextArea();
        textareaExpecteddelivery.setId("iGuestHousekeepingPanel_textareaExpecteddelivery");
        textareaExpecteddelivery.setValue(CServiceConstants.CSERVICE_CONSTANTS.expDeliveryMes());
        textareaExpecteddelivery.setReadOnly(true);
        textareaExpecteddelivery.setHeight(50);
        textareaExpecteddelivery.setWidth(400);
        textareaExpecteddelivery.setFieldLabel(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP);
        
        detailsExpectedDialog = new MultiLanguageDialog();
        detailsExpectedDialog.setAllowBlank(false);
        detailsExpectedDialog.setMultiLine(true);
        detailsExpectedDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				textareaExpecteddelivery.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentExpectedString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton detailsExpectedBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						detailsExpectedDialog.show();
					}
				});
        
        HorizontalPanel expectedHp = new HorizontalPanel();
        VerticalPanel expectedLabelVp = new VerticalPanel();
        VerticalPanel expectedTextareaVp = new VerticalPanel();
        VerticalPanel expectedIconVp = new VerticalPanel();
        
        expectedLabelVp.setWidth(100);
        expectedIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
        
        expectedLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP));
        expectedTextareaVp.add(textareaExpecteddelivery);
        expectedIconVp.add(detailsExpectedBtn);
        
        expectedHp.add(expectedLabelVp);
        expectedHp.add(expectedTextareaVp);
        expectedHp.add(expectedIconVp);
        
        lcc.add(expectedHp);
        
        LayoutContainer lcd = new LayoutContainer();
        lcd.setId("iGuestHousekeepingPanel_lcd");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcd.setLayout(layout);
		lcd.setBorders(false);
		
		fieldset4 = new FieldSet();
		fieldset4.setWidth(650);
		fieldset4.setId("iGuestHousekeepingPanel_fieldset4");
		fieldset4.setHeading(CServiceConstants.CSERVICE_CONSTANTS.fromhousekeeping());
		fieldset4.add(lcd);
	    panel.add(fieldset4);
	    
	    fromHousekeepingField = new TextField<String>();
	    fromHousekeepingField.setId("iGuestHousekeepingPanel_fromHousekeepingField");
	    fromHousekeepingField.setFieldLabel(CoreConstants.CORE_CONSTANTS.from()+ CServiceConstants.FIELD_SEP);
	    fromHousekeepingField.setValue(CServiceConstants.CSERVICE_CONSTANTS.housekeeping());
	    fromHousekeepingField.setReadOnly(true);
	    fromHousekeepingField.setVisible(true);
	    fromHousekeepingField.setEnabled(true);
	    fromHousekeepingField.setWidth(400);
	    fromHousekeepingField.setAllowBlank(false);
//	    econnectrequestfield.setWidth(300);
	    fromHousekeepingField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.housekeeping(), 50);
				}
				return null;
			}
        });
	    
	    fromHousekeepingDialog = new MultiLanguageDialog();
	    fromHousekeepingDialog.setAllowBlank(false);
	    fromHousekeepingDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				fromHousekeepingField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentFromHKString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton fromHousekeepingBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						fromHousekeepingDialog.show();
					}
				});
	    
	    HorizontalPanel fromhousekeepingHp = new HorizontalPanel();
	    VerticalPanel fromhousekeepingLabelVp = new VerticalPanel();
	    VerticalPanel fromhousekeepingTextfieldVp = new VerticalPanel();
	    VerticalPanel fromhousekeepingIconVp = new VerticalPanel();
	    
	    fromhousekeepingIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    
	    fromhousekeepingLabelVp.setWidth(100);
	    fromhousekeepingLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.from()+ CServiceConstants.FIELD_SEP));
	    fromhousekeepingTextfieldVp.add(fromHousekeepingField);
	    fromhousekeepingIconVp.add(fromHousekeepingBtn);
	    fromhousekeepingHp.add(fromhousekeepingLabelVp);
	    fromhousekeepingHp.add(fromhousekeepingTextfieldVp);
	    fromhousekeepingHp.add(fromhousekeepingIconVp);
	    
	    lcd.add(fromhousekeepingHp);
	    
	    LayoutContainer lce = new LayoutContainer();
        lce.setId("iGuestHousekeepingPanel_lce");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lce.setLayout(layout);
		lce.setBorders(false);
		
		fieldset5 = new FieldSet();
		fieldset5.setWidth(650);
		fieldset5.setId("iGuestHousekeepingPanel_fieldset5");
		fieldset5.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjecthousekeepingorder());
		fieldset5.add(lce);
	    panel.add(fieldset5);
	    
	    subjectHousekeepingField = new TextField<String>();
	    subjectHousekeepingField.setId("iGuestHousekeepingPanel_subjectHousekeepingField");
	    subjectHousekeepingField.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectHousekeepingField.setValue(CServiceConstants.CSERVICE_CONSTANTS.housekeepingorder());
	    subjectHousekeepingField.setReadOnly(true);
	    subjectHousekeepingField.setVisible(true);
	    subjectHousekeepingField.setEnabled(true);
	    subjectHousekeepingField.setWidth(400);
	    subjectHousekeepingField.setAllowBlank(false);
//	    econnectrequestfield.setWidth(300);
	    subjectHousekeepingField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.housekeepingorder(), 50);
				}
				return null;
			}
        });
	    
	    subjectHousekeepingDialog = new MultiLanguageDialog();
	    subjectHousekeepingDialog.setAllowBlank(false);
	    subjectHousekeepingDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectHousekeepingField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectHKSring.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}
				else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectHousekeepingBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectHousekeepingDialog.show();
					}
				});
	    
	    HorizontalPanel subjectchangedHp = new HorizontalPanel();
	    VerticalPanel subjectLabelVp = new VerticalPanel();
	    VerticalPanel subjectTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectIconVp = new VerticalPanel();
	    subjectLabelVp.setWidth(100);
	    subjectIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectTextfieldVp.add(subjectHousekeepingField);
	    subjectIconVp.add(subjectHousekeepingBtn);
	    subjectchangedHp.add(subjectLabelVp);
	    subjectchangedHp.add(subjectTextfieldVp);
	    subjectchangedHp.add(subjectIconVp);
	    
	    lce.add(subjectchangedHp);
	    
	    LayoutContainer lcf = new LayoutContainer();
        lcf.setId("iGuestHousekeepingPanel_lcf");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcf.setLayout(layout);
		lcf.setBorders(false);
		
		fieldset6 = new FieldSet();
		fieldset6.setWidth(650);
		fieldset6.setId("iGuestHousekeepingPanel_fieldset6");
		fieldset6.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectorderchange());
		fieldset6.add(lcf);
	    panel.add(fieldset6);
	    
	    subjectOrderChange = new TextField<String>();
	    subjectOrderChange.setId("iGuestHousekeepingPanel_subjectOrderChange");
	    subjectOrderChange.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderChange.setValue(CServiceConstants.CSERVICE_CONSTANTS.orderchange());
	    subjectOrderChange.setReadOnly(true);
	    subjectOrderChange.setVisible(true);
	    subjectOrderChange.setEnabled(true);
	    subjectOrderChange.setWidth(400);
	    subjectOrderChange.setAllowBlank(false);
//	    econnectrequestfield.setWidth(300);
	    subjectOrderChange.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.housekeepingorder(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderChangeDialog = new MultiLanguageDialog();
	    subjectOrderChangeDialog.setAllowBlank(false);
	    subjectOrderChangeDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderChange.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderChangeString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderChangeBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderChangeDialog.show();
					}
				});
	    
	    HorizontalPanel subjectOrderHp = new HorizontalPanel();
	    VerticalPanel subjectOrderLabelVp = new VerticalPanel();
	    VerticalPanel subjectOrderTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectOrderIconVp = new VerticalPanel();
	    subjectOrderLabelVp.setWidth(100);
	    subjectOrderIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectOrderLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectOrderTextfieldVp.add(subjectOrderChange);
	    subjectOrderIconVp.add(subjectOrderChangeBtn);
	    subjectOrderHp.add(subjectOrderLabelVp);
	    subjectOrderHp.add(subjectOrderTextfieldVp);
	    subjectOrderHp.add(subjectOrderIconVp);
	    
	    lcf.add(subjectOrderHp);
	    
	    LayoutContainer lcg = new LayoutContainer();
        lcg.setId("iGuestHousekeepingPanel_lcg");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcg.setLayout(layout);
		lcg.setBorders(false);
		
		fieldset7 = new FieldSet();
		fieldset7.setWidth(650);
		fieldset7.setId("iGuestHousekeepingPanel_fieldset7");
		fieldset7.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectordercancellation());
		fieldset7.add(lcg);
	    panel.add(fieldset7);
	    
	    subjectOrderCancellation = new TextField<String>();
	    subjectOrderCancellation.setId("iGuestHousekeepingPanel_subjectOrderCancellation");
	    subjectOrderCancellation.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderCancellation.setValue(CServiceConstants.CSERVICE_CONSTANTS.ordercancellation());
	    subjectOrderCancellation.setReadOnly(true);
	    subjectOrderCancellation.setVisible(true);
	    subjectOrderCancellation.setEnabled(true);
	    subjectOrderCancellation.setWidth(400);
	    subjectOrderCancellation.setAllowBlank(false);
//	    econnectrequestfield.setWidth(300);
	    subjectOrderCancellation.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.ordercancellation(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderCancelDialog = new MultiLanguageDialog();
	    subjectOrderCancelDialog.setAllowBlank(false);
	    subjectOrderCancelDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderCancellation.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderCancelString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					isChange=false;
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderCancelBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderCancelDialog.show();
					}
				});
	    
	    HorizontalPanel subjectCancelHp = new HorizontalPanel();
	    VerticalPanel subjectCancelLabelVp = new VerticalPanel();
	    VerticalPanel subjectCancelTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectCancelIconVp = new VerticalPanel();
	    subjectCancelLabelVp.setWidth(100);
	    subjectCancelIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectCancelLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectCancelTextfieldVp.add(subjectOrderCancellation);
	    subjectCancelIconVp.add(subjectOrderCancelBtn);
	    subjectCancelHp.add(subjectCancelLabelVp);
	    subjectCancelHp.add(subjectCancelTextfieldVp);
	    subjectCancelHp.add(subjectCancelIconVp);
	    
	    lcg.add(subjectCancelHp);
	    
	    LayoutContainer lcOrdermessagetemplate = new LayoutContainer();
	    lcOrdermessagetemplate.setId("iGuestHousekeepingPanel_lcordermessagetemplate");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcOrdermessagetemplate.setLayout(layout);
		lcOrdermessagetemplate.setBorders(false);
		
		fieldsetordermes = new FieldSet();
		fieldsetordermes.setWidth(650);
		fieldsetordermes.setId("iGuestHousekeepingPanel_fieldsetordermes");
		fieldsetordermes.setHeading(CServiceConstants.CSERVICE_CONSTANTS.ordermessagetemplate() + CoreConstants.REQURIED_FIELD_LABEL);
		fieldsetordermes.add(lcOrdermessagetemplate);
	    panel.add(fieldsetordermes);
	    
	    
//	    orderMesTemCombox = new EasyClearCombobox<OrderMessageTemplateGWTEnumModelData>();
//	    orderMesTemCombox.setWidth(200);
//	    orderMesTemCombox.setId("RestaurantConfigPanel_orderMesTemCombox");
//	    orderMesTemCombox.setEnabled(true);
//	    orderMesTemCombox.setEditable(false);
//	    orderMesTemCombox.setForceSelection(true);
//	    orderMesTemCombox.setTriggerAction(TriggerAction.ALL);
//	    orderMesTemCombox.setDisplayField(CoreConstants.FULLTNAME);
//	    orderMesTemCombox.setWidth(365);
//	    orderMesTemStore = new ListStore<OrderMessageTemplateGWTEnumModelData>();
//	    for (OrderMessageTemplateGWTEnum cm : OrderMessageTemplateGWTEnum.values()) {
//	    	orderMesTemStore.add(new OrderMessageTemplateGWTEnumModelData(cm));
//		}
//		orderMesTemCombox.setStore(orderMesTemStore);
//		orderMesTemCombox.addSelectionChangedListener(new SelectionChangedListener<OrderMessageTemplateGWTEnumModelData>() {
//			
//			@Override
//			public void selectionChanged(
//					SelectionChangedEvent<OrderMessageTemplateGWTEnumModelData> se) {
//				// TODO Auto-generated method stub
//				
//			}
//		});
		
		textareaOrdermessagetemplate = new TextArea();
		textareaOrdermessagetemplate.setId("iGuestHousekeepingPanel_textareaOrdermessagetemplate");
//		textareaOrdermessagetemplate.setValue(CServiceConstants.CSERVICE_CONSTANTS.outofreservationmes());
		textareaOrdermessagetemplate.setHeight(150);
		textareaOrdermessagetemplate.setWidth(400);
		textareaOrdermessagetemplate.setReadOnly(true);
		textareaOrdermessagetemplate.setAllowBlank(false);
		textareaOrdermessagetemplate.setFieldLabel(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP);
		
		HorizontalPanel orderMesTemHp = new HorizontalPanel();
		VerticalPanel orderMesTemLabelVp = new VerticalPanel();
		VerticalPanel orderMesTemTextAreaVp = new VerticalPanel();
		VerticalPanel orderMesTemIconVp = new VerticalPanel();
		orderMesTemLabelVp.setWidth(100);
		orderMesTemIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
		orderMesTemLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.details()+ CServiceConstants.FIELD_SEP));
		orderMesTemTextAreaVp.add(textareaOrdermessagetemplate);
		orderMesTemIconVp.add(MultiEditBtn());
		orderMesTemHp.add(orderMesTemLabelVp);
		orderMesTemHp.add(orderMesTemTextAreaVp);
		orderMesTemHp.add(orderMesTemIconVp);
	    
	    lcOrdermessagetemplate.add(orderMesTemHp);
	    
	    LayoutContainer lcSubjectordertimeout = new LayoutContainer();
	    lcSubjectordertimeout.setId("iGuestHousekeepingPanel_lcSubjectordertimeout");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcSubjectordertimeout.setLayout(layout);
		lcSubjectordertimeout.setBorders(false);

		fieldsetSubjectordertimeout = new FieldSet();
		fieldsetSubjectordertimeout.setWidth(650);
		fieldsetSubjectordertimeout.setId("iGuestHousekeepingPanel_fieldsetSubjectordertimeout");
		fieldsetSubjectordertimeout.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectordertimeoutalert());
		fieldsetSubjectordertimeout.add(lcSubjectordertimeout);
	    panel.add(fieldsetSubjectordertimeout);

	    subjectOrderTimeoutAlertField = new TextField<String>();
	    subjectOrderTimeoutAlertField.setId("iGuestHousekeepingPanel_subjectOrderTimeoutAlert");
	    subjectOrderTimeoutAlertField.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderTimeoutAlertField.setValue(CServiceConstants.CSERVICE_CONSTANTS.ordertimeoutalert());
	    subjectOrderTimeoutAlertField.setReadOnly(true);
	    subjectOrderTimeoutAlertField.setVisible(true);
	    subjectOrderTimeoutAlertField.setEnabled(true);
	    subjectOrderTimeoutAlertField.setWidth(400);
	    subjectOrderTimeoutAlertField.setAllowBlank(false);

	    subjectOrderTimeoutAlertField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.ordertimeoutalert(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderTimeoutDialog = new MultiLanguageDialog();
	    subjectOrderTimeoutDialog.setAllowBlank(false);
	    subjectOrderTimeoutDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderTimeoutAlertField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderTimeoutString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					isChange=false;
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderTimeoutBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderTimeoutDialog.show();
					}
				});
	    
	    HorizontalPanel subjectTimeoutHp = new HorizontalPanel();
	    VerticalPanel subjectTimeoutLabelVp = new VerticalPanel();
	    VerticalPanel subjectTimeoutTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectTimeoutIconVp = new VerticalPanel();
	    subjectTimeoutLabelVp.setWidth(100);
	    subjectTimeoutIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectTimeoutLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectTimeoutTextfieldVp.add(subjectOrderTimeoutAlertField);
	    subjectTimeoutIconVp.add(subjectOrderTimeoutBtn);
	    subjectTimeoutHp.add(subjectTimeoutLabelVp);
	    subjectTimeoutHp.add(subjectTimeoutTextfieldVp);
	    subjectTimeoutHp.add(subjectTimeoutIconVp);

	    lcSubjectordertimeout.add(subjectTimeoutHp);
	    
	    LayoutContainer lcSubjectorderchangetimeout = new LayoutContainer();
	    lcSubjectorderchangetimeout.setId("iGuestHousekeepingPanel_lcSubjectorderchangetimeout");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcSubjectorderchangetimeout.setLayout(layout);
		lcSubjectorderchangetimeout.setBorders(false);

		fieldsetSubjectorderChangetimeout = new FieldSet();
		fieldsetSubjectorderChangetimeout.setWidth(650);
		fieldsetSubjectorderChangetimeout.setId("iGuestHousekeepingPanel_fieldsetSubjectorderChangetimeout");
		fieldsetSubjectorderChangetimeout.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectorderchangetimeoutalert());
		fieldsetSubjectorderChangetimeout.add(lcSubjectorderchangetimeout);
	    panel.add(fieldsetSubjectorderChangetimeout);

	    subjectOrderChangeTimeoutAlertField = new TextField<String>();
	    subjectOrderChangeTimeoutAlertField.setId("iGuestHousekeepingPanel_subjectOrderTimeoutAlert");
	    subjectOrderChangeTimeoutAlertField.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderChangeTimeoutAlertField.setValue(CServiceConstants.CSERVICE_CONSTANTS.orderchangetimeoutalert());
	    subjectOrderChangeTimeoutAlertField.setReadOnly(true);
	    subjectOrderChangeTimeoutAlertField.setVisible(true);
	    subjectOrderChangeTimeoutAlertField.setEnabled(true);
	    subjectOrderChangeTimeoutAlertField.setWidth(400);
	    subjectOrderChangeTimeoutAlertField.setAllowBlank(false);

	    subjectOrderChangeTimeoutAlertField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.orderchangetimeoutalert(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderChangeTimeoutDialog = new MultiLanguageDialog();
	    subjectOrderChangeTimeoutDialog.setAllowBlank(false);
	    subjectOrderChangeTimeoutDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderChangeTimeoutAlertField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderChangeTimeoutString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderChangeTimeoutBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderChangeTimeoutDialog.show();
					}
				});
	    
	    HorizontalPanel subjectChangeTimeoutHp = new HorizontalPanel();
	    VerticalPanel subjectChangeTimeoutLabelVp = new VerticalPanel();
	    VerticalPanel subjectChangeTimeoutTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectChangeTimeoutIconVp = new VerticalPanel();
	    subjectChangeTimeoutLabelVp.setWidth(100);
	    subjectChangeTimeoutIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectChangeTimeoutLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectChangeTimeoutTextfieldVp.add(subjectOrderChangeTimeoutAlertField);
	    subjectChangeTimeoutIconVp.add(subjectOrderChangeTimeoutBtn);
	    subjectChangeTimeoutHp.add(subjectChangeTimeoutLabelVp);
	    subjectChangeTimeoutHp.add(subjectChangeTimeoutTextfieldVp);
	    subjectChangeTimeoutHp.add(subjectChangeTimeoutIconVp);

	    lcSubjectorderchangetimeout.add(subjectChangeTimeoutHp);
	    
	    LayoutContainer lcSubjectorderCanceltimeout = new LayoutContainer();
	    lcSubjectorderCanceltimeout.setId("iGuestHousekeepingPanel_lcSubjectorderCanceltimeout");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcSubjectorderCanceltimeout.setLayout(layout);
		lcSubjectorderCanceltimeout.setBorders(false);

		fieldsetSubjectorderCanceltimeout = new FieldSet();
		fieldsetSubjectorderCanceltimeout.setWidth(650);
		fieldsetSubjectorderCanceltimeout.setId("iGuestHousekeepingPanel_fieldsetSubjectorderCanceltimeout");
		fieldsetSubjectorderCanceltimeout.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectordercancellationtimeoutalert());
		fieldsetSubjectorderCanceltimeout.add(lcSubjectorderCanceltimeout);
	    panel.add(fieldsetSubjectorderCanceltimeout);

	    subjectOrderCancelTimeoutAlertField = new TextField<String>();
	    subjectOrderCancelTimeoutAlertField.setId("iGuestHousekeepingPanel_subjectOrderTimeoutAlert");
	    subjectOrderCancelTimeoutAlertField.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderCancelTimeoutAlertField.setValue(CServiceConstants.CSERVICE_CONSTANTS.ordercancellationtimeoutalert());
	    subjectOrderCancelTimeoutAlertField.setReadOnly(true);
	    subjectOrderCancelTimeoutAlertField.setVisible(true);
	    subjectOrderCancelTimeoutAlertField.setEnabled(true);
	    subjectOrderCancelTimeoutAlertField.setWidth(400);
	    subjectOrderCancelTimeoutAlertField.setAllowBlank(false);
	    subjectOrderCancelTimeoutAlertField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.ordercancellationtimeoutalert(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderCancelTimeoutDialog = new MultiLanguageDialog();
	    subjectOrderCancelTimeoutDialog.setAllowBlank(false);
	    subjectOrderCancelTimeoutDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderCancelTimeoutAlertField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderCancelTimeoutString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderCancelTimeoutBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderCancelTimeoutDialog.show();
					}
				});
	    
	    HorizontalPanel subjectCancelTimeoutHp = new HorizontalPanel();
	    VerticalPanel subjectCancelTimeoutLabelVp = new VerticalPanel();
	    VerticalPanel subjectCancelTimeoutTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectCancelTimeoutIconVp = new VerticalPanel();
	    subjectCancelTimeoutLabelVp.setWidth(100);
	    subjectCancelTimeoutIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectCancelTimeoutLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectCancelTimeoutTextfieldVp.add(subjectOrderCancelTimeoutAlertField);
	    subjectCancelTimeoutIconVp.add(subjectOrderCancelTimeoutBtn);
	    subjectCancelTimeoutHp.add(subjectCancelTimeoutLabelVp);
	    subjectCancelTimeoutHp.add(subjectCancelTimeoutTextfieldVp);
	    subjectCancelTimeoutHp.add(subjectCancelTimeoutIconVp);

	    lcSubjectorderCanceltimeout.add(subjectCancelTimeoutHp);
	    
	    // order time out alert message template
	    
	    LayoutContainer lcOrderTimeoutmessagetemplate = new LayoutContainer();
	    lcOrderTimeoutmessagetemplate.setId("iGuestHousekeepingPanel_lcOrderTimeoutmessagetemplate");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcOrderTimeoutmessagetemplate.setLayout(layout);
		lcOrderTimeoutmessagetemplate.setBorders(false);
		
		fieldsetTimeoutordermes = new FieldSet();
		fieldsetTimeoutordermes.setWidth(650);
		fieldsetTimeoutordermes.setId("iGuestHousekeepingPanel_fieldsetTimeoutordermes");
		fieldsetTimeoutordermes.setHeading(CServiceConstants.CSERVICE_CONSTANTS.ordertimeoutalertmessagetemplate() + CoreConstants.REQURIED_FIELD_LABEL);
		fieldsetTimeoutordermes.add(lcOrderTimeoutmessagetemplate);
	    panel.add(fieldsetTimeoutordermes);
	    
	    
//	    orderTimeoutMesTemCombox = new EasyClearCombobox<OrderMessageTemplateGWTEnumModelData>();
//	    orderTimeoutMesTemCombox.setWidth(200);
//	    orderTimeoutMesTemCombox.setId("RestaurantConfigPanel_orderMesTemCombox");
//	    orderTimeoutMesTemCombox.setEnabled(true);
//	    orderTimeoutMesTemCombox.setEditable(false);
//	    orderTimeoutMesTemCombox.setForceSelection(true);
//	    orderTimeoutMesTemCombox.setTriggerAction(TriggerAction.ALL);
//	    orderTimeoutMesTemCombox.setDisplayField(CoreConstants.FULLTNAME);
//	    orderTimeoutMesTemCombox.setWidth(365);
//	    orderTimeoutMesTemStore = new ListStore<OrderMessageTemplateGWTEnumModelData>();
//	    for (OrderMessageTemplateGWTEnum cm : OrderMessageTemplateGWTEnum.values()) {
//	    	orderTimeoutMesTemStore.add(new OrderMessageTemplateGWTEnumModelData(cm));
//		}
//		orderTimeoutMesTemCombox.setStore(orderTimeoutMesTemStore);
//		orderTimeoutMesTemCombox.addSelectionChangedListener(new SelectionChangedListener<OrderMessageTemplateGWTEnumModelData>() {
//			
//			@Override
//			public void selectionChanged(
//					SelectionChangedEvent<OrderMessageTemplateGWTEnumModelData> se) {
//				// TODO Auto-generated method stub
//				
//			}
//		});
		
		textareaOrderTimeoutmessagetemplate = new TextArea();
		textareaOrderTimeoutmessagetemplate.setId("iGuestHousekeepingPanel_textareaOrderTimeoutmessagetemplate");
		textareaOrderTimeoutmessagetemplate.setHeight(150);
		textareaOrderTimeoutmessagetemplate.setWidth(400);
		textareaOrderTimeoutmessagetemplate.setReadOnly(true);
		textareaOrderTimeoutmessagetemplate.setAllowBlank(false);
		textareaOrderTimeoutmessagetemplate.setFieldLabel(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP);
		
		HorizontalPanel orderTimeoutMesTemHp = new HorizontalPanel();
		VerticalPanel orderTimeoutMesTemLabelVp = new VerticalPanel();
		VerticalPanel orderTimeoutMesTemComboxVp = new VerticalPanel();
		VerticalPanel orderTimeoutMesTemIconVp = new VerticalPanel();
		orderTimeoutMesTemLabelVp.setWidth(100);
		orderTimeoutMesTemIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
		orderTimeoutMesTemLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.details()+ CServiceConstants.FIELD_SEP));
		orderTimeoutMesTemComboxVp.add(textareaOrderTimeoutmessagetemplate);
		orderTimeoutMesTemIconVp.add(MultiEditBtn());
		orderTimeoutMesTemHp.add(orderTimeoutMesTemLabelVp);
		orderTimeoutMesTemHp.add(orderTimeoutMesTemComboxVp);
		orderTimeoutMesTemHp.add(orderTimeoutMesTemIconVp);
	    
	    lcOrderTimeoutmessagetemplate.add(orderTimeoutMesTemHp);
//	    lcOrderTimeoutmessagetemplate.add(textareaOrderTimeoutmessagetemplate);
	    
	    // subject order Acknowledgement
	    
	    LayoutContainer lcSubjectorderAcknowledgement = new LayoutContainer();
	    lcSubjectorderAcknowledgement.setId("iGuestHousekeepingPanel_lcSubjectorderAcknowledgement");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcSubjectorderAcknowledgement.setLayout(layout);
		lcSubjectorderAcknowledgement.setBorders(false);

		fieldsetSubjectorderAcknowledgement = new FieldSet();
		fieldsetSubjectorderAcknowledgement.setWidth(650);
		fieldsetSubjectorderAcknowledgement.setId("iGuestHousekeepingPanel_fieldsetSubjectorderAcknowledgement");
		fieldsetSubjectorderAcknowledgement.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectorderacknowledgement() + CoreConstants.REQURIED_FIELD_LABEL);
		fieldsetSubjectorderAcknowledgement.add(lcSubjectorderAcknowledgement);
	    panel.add(fieldsetSubjectorderAcknowledgement);

	    subjectOrderAcknowledgementField = new TextField<String>();
	    subjectOrderAcknowledgementField.setId("iGuestHousekeepingPanel_subjectOrderAcknowledgementField");
	    subjectOrderAcknowledgementField.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderAcknowledgementField.setValue(CServiceConstants.CSERVICE_CONSTANTS.orderacknowledgement());
	    subjectOrderAcknowledgementField.setReadOnly(true);
	    subjectOrderAcknowledgementField.setVisible(true);
	    subjectOrderAcknowledgementField.setEnabled(true);
	    subjectOrderAcknowledgementField.setWidth(400);
	    subjectOrderAcknowledgementField.setAllowBlank(false);
	    subjectOrderAcknowledgementField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.orderacknowledgement(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderAcknowledgementDialog = new MultiLanguageDialog();
	    subjectOrderAcknowledgementDialog.setAllowBlank(false);
	    subjectOrderAcknowledgementDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderAcknowledgementField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderAckString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderAcknowledgementBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderAcknowledgementDialog.show();
					}
				});
	    
	    HorizontalPanel subjectAcknowledgementHp = new HorizontalPanel();
	    VerticalPanel subjectAcknowledgementLabelVp = new VerticalPanel();
	    VerticalPanel subjectAcknowledgementTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectAcknowledgementIconVp = new VerticalPanel();
	    subjectAcknowledgementLabelVp.setWidth(100);
	    subjectAcknowledgementIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectAcknowledgementLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectAcknowledgementTextfieldVp.add(subjectOrderAcknowledgementField);
	    subjectAcknowledgementIconVp.add(subjectOrderAcknowledgementBtn);
	    subjectAcknowledgementHp.add(subjectAcknowledgementLabelVp);
	    subjectAcknowledgementHp.add(subjectAcknowledgementTextfieldVp);
	    subjectAcknowledgementHp.add(subjectAcknowledgementIconVp);

	    lcSubjectorderAcknowledgement.add(subjectAcknowledgementHp);
	    
	    // order Acknowledgment message template
	    
	    LayoutContainer lcOrderAcknowledgementmessagetemplate = new LayoutContainer();
	    lcOrderAcknowledgementmessagetemplate.setId("iGuestHousekeepingPanel_lcOrderAcknowledgementmessagetemplate");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcOrderAcknowledgementmessagetemplate.setLayout(layout);
		lcOrderAcknowledgementmessagetemplate.setBorders(false);
		
		fieldsetAcknowledgementordermes = new FieldSet();
		fieldsetAcknowledgementordermes.setWidth(650);
		fieldsetAcknowledgementordermes.setId("iGuestHousekeepingPanel_fieldsetAcknowledgementordermes");
		fieldsetAcknowledgementordermes.setHeading(CServiceConstants.CSERVICE_CONSTANTS.orderacknowledgement());
		fieldsetAcknowledgementordermes.add(lcOrderAcknowledgementmessagetemplate);
	    panel.add(fieldsetAcknowledgementordermes);
	    
//	    orderAcknowledgementMesTemCombox = new EasyClearCombobox<OrderAcknowledgementTemplateGWTEnumModelData>();
//	    orderAcknowledgementMesTemCombox.setWidth(200);
//	    orderAcknowledgementMesTemCombox.setId("RestaurantConfigPanel_orderMesTemCombox");
//	    orderAcknowledgementMesTemCombox.setEnabled(true);
//	    orderAcknowledgementMesTemCombox.setEditable(false);
//	    orderAcknowledgementMesTemCombox.setForceSelection(true);
//	    orderAcknowledgementMesTemCombox.setTriggerAction(TriggerAction.ALL);
//	    orderAcknowledgementMesTemCombox.setDisplayField(CoreConstants.FULLTNAME);
//	    orderAcknowledgementMesTemCombox.setWidth(365);
//	    orderAcknowledgementMesTemStore = new ListStore<OrderAcknowledgementTemplateGWTEnumModelData>();
//	    for (OrderAcknowledgementTemplateGWTEnum cm : OrderAcknowledgementTemplateGWTEnum.values()) {
//	    	orderAcknowledgementMesTemStore.add(new OrderAcknowledgementTemplateGWTEnumModelData(cm));
//		}
//	    orderAcknowledgementMesTemCombox.setStore(orderAcknowledgementMesTemStore);
//	    orderAcknowledgementMesTemCombox.addSelectionChangedListener(new SelectionChangedListener<OrderAcknowledgementTemplateGWTEnumModelData>() {
//			
//			@Override
//			public void selectionChanged(
//					SelectionChangedEvent<OrderAcknowledgementTemplateGWTEnumModelData> se) {
//				// TODO Auto-generated method stub
//				
//			}
//		});
		
		textareaAcknowledgementmessagetemplate = new TextArea();
		textareaAcknowledgementmessagetemplate.setId("iGuestHousekeepingPanel_textareaAcknowledgementmessagetemplate");
		textareaAcknowledgementmessagetemplate.setHeight(150);
		textareaAcknowledgementmessagetemplate.setWidth(400);
		textareaAcknowledgementmessagetemplate.setReadOnly(true);
		textareaAcknowledgementmessagetemplate.setAllowBlank(false);
		textareaAcknowledgementmessagetemplate.setFieldLabel(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP);
		
		HorizontalPanel orderAcknowledgementMesTemHp = new HorizontalPanel();
		VerticalPanel orderAcknowledgementMesTemLabelVp = new VerticalPanel();
		VerticalPanel orderAcknowledgementMesTemComboxVp = new VerticalPanel();
		VerticalPanel orderAcknowledgementMesTemIconVp = new VerticalPanel();
		orderAcknowledgementMesTemLabelVp.setWidth(100);
		orderAcknowledgementMesTemIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
		orderAcknowledgementMesTemLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.details()+ CServiceConstants.FIELD_SEP));
		orderAcknowledgementMesTemComboxVp.add(textareaAcknowledgementmessagetemplate);
		orderAcknowledgementMesTemIconVp.add(MultiEditBtn());
		orderAcknowledgementMesTemHp.add(orderAcknowledgementMesTemLabelVp);
		orderAcknowledgementMesTemHp.add(orderAcknowledgementMesTemComboxVp);
		orderAcknowledgementMesTemHp.add(orderAcknowledgementMesTemIconVp);
	    
		lcOrderAcknowledgementmessagetemplate.add(orderAcknowledgementMesTemHp);
//		lcOrderAcknowledgementmessagetemplate.add(textareaAcknowledgementmessagetemplate);
		
		//subject change acknowledgement 
		
		LayoutContainer lcSubjectorderChangeAcknowledgement = new LayoutContainer();
		lcSubjectorderChangeAcknowledgement.setId("iGuestHousekeepingPanel_lcSubjectorderAcknowledgement");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcSubjectorderChangeAcknowledgement.setLayout(layout);
		lcSubjectorderChangeAcknowledgement.setBorders(false);

		fieldsetSubjectorderChangeAcknowledgement = new FieldSet();
		fieldsetSubjectorderChangeAcknowledgement.setWidth(650);
		fieldsetSubjectorderChangeAcknowledgement.setId("iGuestHousekeepingPanel_fieldsetSubjectorderChangeAcknowledgement");
		fieldsetSubjectorderChangeAcknowledgement.setHeading(CServiceConstants.CSERVICE_CONSTANTS.subjectorderchangeacknowledgement() + CoreConstants.REQURIED_FIELD_LABEL);
		fieldsetSubjectorderChangeAcknowledgement.add(lcSubjectorderChangeAcknowledgement);
	    panel.add(fieldsetSubjectorderChangeAcknowledgement);

	    subjectOrderChangeAcknowledgementField = new TextField<String>();
	    subjectOrderChangeAcknowledgementField.setId("iGuestHousekeepingPanel_subjectOrderChangeAcknowledgementField");
	    subjectOrderChangeAcknowledgementField.setFieldLabel(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP);
	    subjectOrderChangeAcknowledgementField.setValue(CServiceConstants.CSERVICE_CONSTANTS.orderchangeacknowledgement());
	    subjectOrderChangeAcknowledgementField.setReadOnly(true);
	    subjectOrderChangeAcknowledgementField.setVisible(true);
	    subjectOrderChangeAcknowledgementField.setEnabled(true);
	    subjectOrderChangeAcknowledgementField.setWidth(400);
	    subjectOrderChangeAcknowledgementField.setAllowBlank(false);
	    subjectOrderChangeAcknowledgementField.setValidator(new Validator(){
			@Override
			public String validate(Field<?> field, String value) {
				if(value != null 
				   && !value.trim().isEmpty()
				   && value.trim().length() > 50){
					return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
							CServiceConstants.CSERVICE_CONSTANTS.orderchangeacknowledgement(), 50);
				}
				return null;
			}
        });
	    
	    subjectOrderChangeAcknowledgementDialog = new MultiLanguageDialog();
	    subjectOrderChangeAcknowledgementDialog.setAllowBlank(false);
	    subjectOrderChangeAcknowledgementDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

			@Override
			public void onButtonOKClicked(
					MultiLanguageDialogOKEvent event) {
				// Get map language-text
				Map<String, String> values = event.getSource().getLanguageTexts();
				// Display English in label
				subjectOrderChangeAcknowledgementField.setValue(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
				if(!currentSubjectOrderChangeAckString.equals(values.get(MultiLanguageDialog.DEFAULT_LANGUAGE))||isChange){
					saveButton.setEnabled(true);
					isChange=true;
				}else
					saveButton.setEnabled(false);
				//netTextField.setValue(values.get("ja"));
				//Info.display("result", values.get("en_us") + "-" + values.get("ko"));

			}
		});
		final HighLightIconButton subjectOrderChangeAcknowledgementBtn = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						subjectOrderChangeAcknowledgementDialog.show();
					}
				});
	    
	    HorizontalPanel subjectChangeAcknowledgementHp = new HorizontalPanel();
	    VerticalPanel subjectChangeAcknowledgementLabelVp = new VerticalPanel();
	    VerticalPanel subjectChangeAcknowledgementTextfieldVp = new VerticalPanel();
	    VerticalPanel subjectChangeAcknowledgementIconVp = new VerticalPanel();
	    subjectChangeAcknowledgementLabelVp.setWidth(100);
	    subjectChangeAcknowledgementIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
	    subjectChangeAcknowledgementLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.subject()+ CServiceConstants.FIELD_SEP));
	    subjectChangeAcknowledgementTextfieldVp.add(subjectOrderChangeAcknowledgementField);
	    subjectChangeAcknowledgementIconVp.add(subjectOrderChangeAcknowledgementBtn);
	    subjectChangeAcknowledgementHp.add(subjectChangeAcknowledgementLabelVp);
	    subjectChangeAcknowledgementHp.add(subjectChangeAcknowledgementTextfieldVp);
	    subjectChangeAcknowledgementHp.add(subjectChangeAcknowledgementIconVp);

	    lcSubjectorderChangeAcknowledgement.add(subjectChangeAcknowledgementHp);
	    
	    //change acknowledgement message template
	    
	    LayoutContainer lcOrderChangeAcknowledgementmessagetemplate = new LayoutContainer();
	    lcOrderChangeAcknowledgementmessagetemplate.setId("iGuestHousekeepingPanel_lcOrderAcknowledgementmessagetemplate");
	    layout = new FormLayout();
		layout.setLabelAlign(LabelAlign.LEFT);
		layout.setLabelWidth(130);
		layout.setDefaultWidth(360);
		layout.setLabelSeparator("");
		lcOrderChangeAcknowledgementmessagetemplate.setLayout(layout);
		lcOrderChangeAcknowledgementmessagetemplate.setBorders(false);
		
		fieldsetChangeAcknowledgementordermes = new FieldSet();
		fieldsetChangeAcknowledgementordermes.setWidth(650);
		fieldsetChangeAcknowledgementordermes.setId("iGuestHousekeepingPanel_fieldsetChangeAcknowledgementordermes");
		fieldsetChangeAcknowledgementordermes.setHeading(CServiceConstants.CSERVICE_CONSTANTS.orderchangeacknowledgement());
		fieldsetChangeAcknowledgementordermes.add(lcOrderChangeAcknowledgementmessagetemplate);
	    panel.add(fieldsetChangeAcknowledgementordermes);
	    
	    
//	    orderChangeAcknowledgementMesTemCombox = new EasyClearCombobox<OrderAcknowledgementTemplateGWTEnumModelData>();
//	    orderChangeAcknowledgementMesTemCombox.setWidth(200);
//	    orderChangeAcknowledgementMesTemCombox.setId("RestaurantConfigPanel_orderMesTemCombox");
//	    orderChangeAcknowledgementMesTemCombox.setEditable(false);
//	    orderChangeAcknowledgementMesTemCombox.setEnabled(true);
//	    orderChangeAcknowledgementMesTemCombox.setForceSelection(true);
//	    orderChangeAcknowledgementMesTemCombox.setTriggerAction(TriggerAction.ALL);
//	    orderChangeAcknowledgementMesTemCombox.setDisplayField(CoreConstants.FULLTNAME);
//	    orderChangeAcknowledgementMesTemCombox.setWidth(365);
//	    orderChangeAcknowledgementMesTemStore = new ListStore<OrderAcknowledgementTemplateGWTEnumModelData>();
//	    for (OrderAcknowledgementTemplateGWTEnum cm : OrderAcknowledgementTemplateGWTEnum.values()) {
//	    	orderChangeAcknowledgementMesTemStore.add(new OrderAcknowledgementTemplateGWTEnumModelData(cm));
//		}
//	    orderChangeAcknowledgementMesTemCombox.setStore(orderChangeAcknowledgementMesTemStore);
//	    orderChangeAcknowledgementMesTemCombox.addSelectionChangedListener(new SelectionChangedListener<OrderAcknowledgementTemplateGWTEnumModelData>() {
//			
//			@Override
//			public void selectionChanged(
//					SelectionChangedEvent<OrderAcknowledgementTemplateGWTEnumModelData> se) {
//				// TODO Auto-generated method stub
//				
//			}
//		});
		
		textareaChangeAcknowledgementmessagetemplate = new TextArea();
		textareaChangeAcknowledgementmessagetemplate.setId("iGuestHousekeepingPanel_textareaChangeAcknowledgementmessagetemplate");
		textareaChangeAcknowledgementmessagetemplate.setHeight(150);
		textareaChangeAcknowledgementmessagetemplate.setWidth(400);
		textareaChangeAcknowledgementmessagetemplate.setReadOnly(true);
		textareaChangeAcknowledgementmessagetemplate.setAllowBlank(false);
		textareaChangeAcknowledgementmessagetemplate.setFieldLabel(CoreConstants.CORE_CONSTANTS.details() + CServiceConstants.FIELD_SEP);
		
		HorizontalPanel orderChangeAcknowledgementMesTemHp = new HorizontalPanel();
		VerticalPanel orderChangeAcknowledgementMesTemLabelVp = new VerticalPanel();
		VerticalPanel orderChangeAcknowledgementMesTemComboxVp = new VerticalPanel();
		VerticalPanel orderChangeAcknowledgementMesTemIconVp = new VerticalPanel();
		orderChangeAcknowledgementMesTemLabelVp.setWidth(100);
		orderChangeAcknowledgementMesTemIconVp.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "15px");
		orderChangeAcknowledgementMesTemLabelVp.add(new Label(CoreConstants.CORE_CONSTANTS.details()+ CServiceConstants.FIELD_SEP));
		orderChangeAcknowledgementMesTemComboxVp.add(textareaChangeAcknowledgementmessagetemplate);
		orderChangeAcknowledgementMesTemIconVp.add(MultiEditBtn());
		orderChangeAcknowledgementMesTemHp.add(orderChangeAcknowledgementMesTemLabelVp);
		orderChangeAcknowledgementMesTemHp.add(orderChangeAcknowledgementMesTemComboxVp);
		orderChangeAcknowledgementMesTemHp.add(orderChangeAcknowledgementMesTemIconVp);
	    
		lcOrderChangeAcknowledgementmessagetemplate.add(orderChangeAcknowledgementMesTemHp);
//		lcOrderChangeAcknowledgementmessagetemplate.add(textareaChangeAcknowledgementmessagetemplate);
        
	    vp.add(panel);
	    
//	    FormButton saveButton = new FormButton(CoreConstants.CORE_CONSTANTS.save());
	    saveButton = new FormButton(CoreConstants.CORE_CONSTANTS.save());
	    saveButton.setId("iGuestHousekeepingPanel_saveButton");
		saveButton.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "560px");
		saveButton.setEnabled(false);
		saveButton.setSize(60, 30);
		saveButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
			@Override
			public void componentSelected(ButtonEvent ce) {
				if(timeoutmField.isValid() && cancellationminuteField.isValid()
						&& (emailAddressField.isEnabled() ? emailAddressField.isValid() : true)
						&& (serverNameField.isEnabled() ? serverNameField.isValid() : true)
						&& (timeoutmemailField.isEnabled() ? timeoutmemailField.isValid() : true)){
										
					if(printerRadio.getValue()){
						currentHousekeepingConf.setRequestSentTo(0);
						currentHousekeepingConf.setPrinterEmailAction(serverNameField.getValue());
					}
					else if(emailRadio.getValue()){
						currentHousekeepingConf.setRequestSentTo(2);
						currentHousekeepingConf.setPrinterEmailAction(emailAddressField.getValue());
					}
					if(timeoutCheckBox.getValue()){
						currentHousekeepingConf.setTimeOutAlertEnable(true);
						currentHousekeepingConf.setTimeOut(Integer.parseInt(timeoutmField.getValue()));
						currentHousekeepingConf.setTimeOutEmail(timeoutmemailField.getValue());
					}
					else{
						currentHousekeepingConf.setTimeOutAlertEnable(false);
						currentHousekeepingConf.setTimeOut(null);
						currentHousekeepingConf.setTimeOutEmail(null);
					}
					if(cancellationCheckBox.getValue()){
						currentHousekeepingConf.setCancellationLeadTimeDefaultEnable(true);
						currentHousekeepingConf.setCancellationMinutes(Integer.parseInt(cancellationminuteField.getValue()));
					}
					else{
						currentHousekeepingConf.setCancellationLeadTimeDefaultEnable(false);
						currentHousekeepingConf.setCancellationMinutes(null);
					}
					CServiceCommonServiceController.getINSTANCE().saveHousepeepingConfig(currentHousekeepingConf, 
						new AsyncCallbackListener<HouseKeepingConfig>(){

							@Override
							public void onLogin(String username) {
								// TODO Auto-generated method stub
								CServiceCommonServiceController.getINSTANCE().saveHousepeepingConfig(currentHousekeepingConf, this);
							}

							@Override
							public void onFailure(Throwable caught) {
								// TODO Auto-generated method stub
								MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
										CoreConstants.CORE_CONSTANTS.systemError(), null);
							}

							@Override
							public void onSuccess(HouseKeepingConfig result) {
								// TODO Auto-generated method stub
								if(null != result){
									CenteredInfo.displayCompleted(CoreConstants.CORE_CONSTANTS.edited());
								}
							}
					});
					
					saveMultiLanguageMap(detailsOutofReserMap, MultiLanguageConstants.detailsOutofReser);
					saveMultiLanguageMap(detailsExpectedMap, MultiLanguageConstants.detailsExpected);
					saveMultiLanguageMap(fromHousekeepingMap, MultiLanguageConstants.fromHousekeeping);
					saveMultiLanguageMap(subjectHousekeepingMap, MultiLanguageConstants.subjectHousekeeping);
					saveMultiLanguageMap(subjectOrderChangeMap, MultiLanguageConstants.subjectOrderChange);
					saveMultiLanguageMap(subjectOrderCancelMap, MultiLanguageConstants.subjectOrderCancel);
					saveMultiLanguageMap(subjectOrderTimeoutMap, MultiLanguageConstants.subjectOrderTimeout);
					saveMultiLanguageMap(subjectOrderChangeTimeoutMap, MultiLanguageConstants.subjectOrderChangeTimeout);
					saveMultiLanguageMap(subjectOrderCancelTimeoutMap, MultiLanguageConstants.subjectOrderCancelTimeout);
					saveMultiLanguageMap(subjectOrderAcknowledgementMap, MultiLanguageConstants.subjectOrderAcknowledgement);
					saveMultiLanguageMap(subjectOrderChangeAcknowledgementMap, MultiLanguageConstants.subjectOrderChangeAcknowledgement);
					
					onShow();
					saveButton.setEnabled(false);
					isChange=false;
				}
			}
		});
		
	    vp.add(saveButton);
	    
	    CServiceCommonServiceController.getINSTANCE().getLanguageMap(
				new AsyncCallbackListener<Map<String, String>>() {

					@Override
					public void onLogin(String username) {
						CServiceCommonServiceController.getINSTANCE().getLanguageMap(this);
					}

					@Override
					public void onSuccess(Map<String, String> result) {
						final Map<String, String> languages = result;
						detailsOutofReserDialog.setLanguages(languages);
						detailsExpectedDialog.setLanguages(languages);
						fromHousekeepingDialog.setLanguages(languages);
						subjectHousekeepingDialog.setLanguages(languages);
						subjectOrderChangeDialog.setLanguages(languages);
						subjectOrderCancelDialog.setLanguages(languages);
						subjectOrderTimeoutDialog.setLanguages(languages);
						subjectOrderChangeTimeoutDialog.setLanguages(languages);
						subjectOrderCancelTimeoutDialog.setLanguages(languages);
						subjectOrderAcknowledgementDialog.setLanguages(languages);
						subjectOrderChangeAcknowledgementDialog.setLanguages(languages);
					}

					@Override
					public void onFailure(Throwable caught) {
						Info.display("failure", caught.getMessage());
					}
			});
		
	    add(vp);
		onShow();
	}

	@Override
	public UserAuthority getRequiredAuthority() {
		return CServiceAuthority.cSERVICE_CONFIG;
	}

	@Override
	protected Widget getViewPanel() {
		return vp;
	}

	@Override
	public void onShow() {
		loadProperty();
		myClear();
		CServiceCommonServiceController.getINSTANCE().getHousekeepingConfig(
				SessionContext.getInstance().getPropertyId(), 
				new AsyncCallbackListener<HouseKeepingConfig>(){

					@Override
					public void onLogin(String username) {
						// TODO Auto-generated method stub
						CServiceCommonServiceController.getINSTANCE().getHousekeepingConfig
						(SessionContext.getInstance().getPropertyId(), this);
					}

					@Override
					public void onFailure(Throwable caught) {
						// TODO Auto-generated method stub
						Window.alert("onFaifule");
						MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
								CoreConstants.CORE_CONSTANTS.systemError(), null);
					}

					@Override
					public void onSuccess(HouseKeepingConfig result) {
						// TODO Auto-generated method stub
						if(null != result){
							currentHousekeepingConf = result;
							if(result.getRequestSentTo()==0){
								printerRadio.setValue(true);
								serverNameField.setEnabled(true);
								serverNameField.setValue(result.getPrinterEmailAction());
								econnectRadio.setValue(false);
								emailRadio.setValue(false);
								cconnectRadio.setValue(false);
							}
							else if(result.getRequestSentTo()==1){
								econnectRadio.setValue(true);
								eRequestActionCombox.setEnabled(true);
//								serverNameField.setValue(result.getPrinterEmailAction());
								printerRadio.setValue(false);
								emailRadio.setValue(false);
								cconnectRadio.setValue(false);
							}
							else if(result.getRequestSentTo()==2){
								emailRadio.setValue(true);
								emailAddressField.setEnabled(true);
								emailAddressField.setValue(result.getPrinterEmailAction());
								econnectRadio.setValue(false);
								printerRadio.setValue(false);
								cconnectRadio.setValue(false);
							}
							else{
								cconnectRadio.setValue(true);
								cRequestActionCombox.setEnabled(true);
//								serverNameField.setValue(result.getPrinterEmailAction());
								printerRadio.setValue(false);
								emailRadio.setValue(false);
								econnectRadio.setValue(false);
							}
							if(result.getTimeOutAlertEnable()){
								timeoutCheckBox.setValue(true);
								timeoutmField.setEnabled(true);
								timeoutmField.setValue(result.getTimeOut().toString());
								timeoutmemailField.setEnabled(true);
								timeoutmemailField.setValue(result.getTimeOutEmail());
							}
							if(result.getCancellationLeadTimeDefaultEnable()){
								cancellationCheckBox.setValue(true);
								cancellationminuteField.setEnabled(true);
								cancellationminuteField.setValue(result.getCancellationMinutes().toString());
							}
						}
					}
				});
		
		//get details out of reservation language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.detailsOutofReser,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

	

			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.detailsOutofReser,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
		

			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				detailsOutofReserMap = convertToMap(result1);
				textareaOutofreservation.setValue(detailsOutofReserMap.get("en_us"));
				currentOutOfReserString = textareaOutofreservation.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				detailsOutofReserDialog.setLanguageTexts(detailsOutofReserMap);
			}
		});
		
		//get details expected delivery time language
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.detailsExpected,
						new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

				

					@Override
					public void onLogin(String username) {
						CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.detailsExpected,this);	
						Window.alert("login success!");
					}

					@Override
					public void onFailure(Throwable caught) {
						MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
								CoreConstants.CORE_CONSTANTS.systemError(), null);
						Window.alert("get language fail!");
					}
				

					@Override
					public void onSuccess(
						List<ConstantsLanguageValue> result1) {
						detailsExpectedMap = convertToMap(result1);
						textareaExpecteddelivery.setValue(detailsExpectedMap.get("en_us"));
						currentExpectedString = textareaExpecteddelivery.getValue().trim();
						//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
						detailsExpectedDialog.setLanguageTexts(detailsExpectedMap);
					}
		});
		
		//get from housekeeping language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.fromHousekeeping,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){


			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.fromHousekeeping,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				fromHousekeepingMap = convertToMap(result1);
				fromHousekeepingField.setValue(fromHousekeepingMap.get("en_us"));
				currentFromHKString = fromHousekeepingField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				fromHousekeepingDialog.setLanguageTexts(fromHousekeepingMap);
			}
		});
		
		//get subject housekeeping language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectHousekeeping,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){
			
			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectHousekeeping,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectHousekeepingMap = convertToMap(result1);
				subjectHousekeepingField.setValue(subjectHousekeepingMap.get("en_us"));
				currentSubjectHKSring = subjectHousekeepingField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectHousekeepingDialog.setLanguageTexts(subjectHousekeepingMap);
			}
		});
		
		//get subject order change language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderChange,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){
			
			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderChange,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderChangeMap = convertToMap(result1);
				subjectOrderChange.setValue(subjectOrderChangeMap.get("en_us"));
				currentSubjectOrderChangeString = subjectOrderChange.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderChangeDialog.setLanguageTexts(subjectOrderChangeMap);
			}
		});
		
		//get subject order cancel language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderCancel,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderCancel,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderCancelMap = convertToMap(result1);
				subjectOrderCancellation.setValue(subjectOrderCancelMap.get("en_us"));
				currentSubjectOrderCancelString = subjectOrderCancellation.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderCancelDialog.setLanguageTexts(subjectOrderCancelMap);
			}
		});
		
		//get subject order timeout language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderTimeout,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderTimeout,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderTimeoutMap = convertToMap(result1);
				subjectOrderTimeoutAlertField.setValue(subjectOrderTimeoutMap.get("en_us"));
				currentSubjectOrderTimeoutString = subjectOrderTimeoutAlertField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderTimeoutDialog.setLanguageTexts(subjectOrderTimeoutMap);
			}
		});
		
		//get subject order change timeout language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderChangeTimeout,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){
		
			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderChangeTimeout,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderChangeTimeoutMap = convertToMap(result1);
				subjectOrderChangeTimeoutAlertField.setValue(subjectOrderChangeTimeoutMap.get("en_us"));
				currentSubjectOrderChangeTimeoutString = subjectOrderChangeTimeoutAlertField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderChangeTimeoutDialog.setLanguageTexts(subjectOrderChangeTimeoutMap);
			}
		});
		
		//get subject order cancel timeout language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderCancelTimeout,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderCancelTimeout,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderCancelTimeoutMap = convertToMap(result1);
				subjectOrderCancelTimeoutAlertField.setValue(subjectOrderCancelTimeoutMap.get("en_us"));
				currentSubjectOrderCancelTimeoutString = subjectOrderCancelTimeoutAlertField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderCancelTimeoutDialog.setLanguageTexts(subjectOrderCancelTimeoutMap);
			}
		});
		
		//get subject order acknowledgement language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderAcknowledgement,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderAcknowledgement,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderAcknowledgementMap = convertToMap(result1);
				subjectOrderAcknowledgementField.setValue(subjectOrderAcknowledgementMap.get("en_us"));
				currentSubjectOrderAckString = subjectOrderAcknowledgementField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderAcknowledgementDialog.setLanguageTexts(subjectOrderAcknowledgementMap);
			}
		});
		
		//get subject order change acknowledgement language
		
		CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), MultiLanguageConstants.subjectOrderChangeAcknowledgement,
				new AsyncCallbackListener<List<ConstantsLanguageValue>>(){

			@Override
			public void onLogin(String username) {
				CServiceCommonServiceController.getINSTANCE().getListConstantsLanguage(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),MultiLanguageConstants.subjectOrderChangeAcknowledgement,this);	
				Window.alert("login success!");
			}

			@Override
			public void onFailure(Throwable caught) {
				MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				Window.alert("get language fail!");
			}
			@Override
			public void onSuccess(
				List<ConstantsLanguageValue> result1) {
				subjectOrderChangeAcknowledgementMap = convertToMap(result1);
				subjectOrderChangeAcknowledgementField.setValue(subjectOrderChangeAcknowledgementMap.get("en_us"));
				currentSubjectOrderChangeAckString = subjectOrderChangeAcknowledgementField.getValue().trim();
				//netTextField.setValue(networkAccessNotAvailableConf.get(SessionContext.getInstance().getPropertyLanguage().getDisplayStr()));
				subjectOrderChangeAcknowledgementDialog.setLanguageTexts(subjectOrderChangeAcknowledgementMap);
			}
		});
	}

	public Map<String, String> convertToMap( List<ConstantsLanguageValue> listlang ){
		Map<String, String> resultmap = new HashMap<String, String>();
		for(ConstantsLanguageValue lang : listlang){
			resultmap.put(lang.getId().getLanguageId(), lang.getValue());
		}
		return resultmap;
		
	}
	
	@Override
	public boolean onHide() {
		myClear();
		return true;
	}
	
	private void saveMultiLanguageMap(Map<String, String> abc, String constants){

		for (Entry<String, String> entry : abc.entrySet()) {
			//Window.alert("Key : " + entry.getKey() + " Value : " + entry.getValue());
			if(entry.getValue()!=null){
				final ConstantsLanguageValue multiconstants=new ConstantsLanguageValue();
//				SessionContext.getInstance().getPropertyId()
				//constants=new ConstantsLanguageValueId();
				multiconstants.setId(new ConstantsLanguageValueId(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getOrgId(), constants, entry.getKey()));
				//multiconstants.setId(new ConstantsLanguageValueId(1, 1, "NETWORK_ACCESS_NOT_AVAILABLE", entry.getKey()));
				multiconstants.setValue(entry.getValue());
				multiconstants.setCreated(new Date());
				multiconstants.setUpdated(new Date());
				multiconstants.setCreatedBy(SessionContext.getInstance().getUserId());
				multiconstants.setUpdatedBy(SessionContext.getInstance().getUserId());
				
				CServiceCommonServiceController.getINSTANCE().saveConstantsLanguageValue(multiconstants,
						new AsyncCallbackListener<ConstantsLanguageValue>() {

							@Override
							public void onLogin(String username) {
								CServiceCommonServiceController.getINSTANCE()
										.saveConstantsLanguageValue(multiconstants, this);
							}

							@Override
							public void onFailure(Throwable caught) {
								MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(
										CoreConstants.CORE_CONSTANTS.system(),
										ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
										CoreConstants.CORE_CONSTANTS.systemError(),null);
							}

							@Override
							public void onSuccess(ConstantsLanguageValue result) {
								if (result != null) {
									CenteredInfo.displayCompleted(CoreConstants.CORE_CONSTANTS.edited());
								} else {
									MessageBox.alert(
											CoreConstants.CORE_MESSAGES.operation(
													CoreConstants.CORE_CONSTANTS.system(),
													ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
											CoreConstants.CORE_CONSTANTS.systemError(),null);
								}
							}
				});
			}//Dong if
		}//Dong For
		//CServiceCommonServiceController.getINSTANCE().saveConstantsLanguageValue(constants, callback);
	}
	
	private void myClear(){
		emailAddressField.clear();
		serverNameField.clear();
	}
	
	private boolean isValidNum(String minutes){
		boolean isValid = true;
		for(int i = 0; i < minutes.length() ; i++){
			if(!Character.isDigit(minutes.charAt(i))){
				isValid = false;
				break;
			}
		}
		BigDecimal bd = new BigDecimal(minutes);
		if(isValid && ((bd.compareTo(new BigDecimal(Integer.valueOf(1440))) == 1)
			       || (bd.compareTo(new BigDecimal(Integer.valueOf(1))) == -1))){
			isValid = false;
		}
		return isValid;
	}

	@Override
	public void setFocus() {
		if(isFocus){
			emailAddressField.focus();
		}else{
			serverNameField.focus();
		}
	}
	
	private void loadProperty() {
		propGroupIdNames = SessionContext.getInstance().getPropertyGroup();
		propListStore.removeAll();
		if (0 != propGroupIdNames.size()) {
			int propIndex = 0;
			for (IdNameModel<Property> inm : propGroupIdNames) {
				propListStore.add(new PropertyIdNameModelData(inm));
				if (propIndex == 0) {
					if (SessionContext.getInstance().getPropertyId() == inm.getId()) {
						propIndex = propListStore.getCount() - 1;
					}
				}
			}
			propCombox.setValue(propListStore.getAt(propIndex));
		} else {
			IdNameModel<Property> tempINM = new IdNameModel<Property>(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getPropertyName());
			propListStore.add(new PropertyIdNameModelData(tempINM));
			propCombox.setValue(propListStore.getAt(0));
		}
//		propListStore.removeAll();
//		IdNameModel<Property> tempINM = new IdNameModel<Property>(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getPropertyName());
//		propListStore.add(new PropertyIdNameModelData(tempINM));
//		propCombox.setValue(propListStore.getAt(0));
//		grid.setCurrentProperty(propListStore.getAt(0));
	}
}

